const char* pSource_FBox2InnerShadowKnockout = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor = lerp(scolor, base, fcolor.a) * base.a;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2InnerShadowKnockoutHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor.ar = saturate((1 - fcolor.ar) - (1 - fcolor.ra) * 0.5f);\n"
"    fcolor = (scolor * fcolor.a + scolor2 * fcolor.r\n"
"              + base * (1 - fcolor.a - fcolor.r)) * base.a;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2InnerShadowKnockoutMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor = lerp(scolor, base, fcolor.a) * base.a;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2InnerShadowKnockoutMulHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor.ar = saturate((1 - fcolor.ar) - (1 - fcolor.ra) * 0.5f);\n"
"    fcolor = (scolor * fcolor.a + scolor2 * fcolor.r\n"
"              + base * (1 - fcolor.a - fcolor.r)) * base.a;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2InnerShadow = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor = lerp(scolor, base, fcolor.a) * base.a;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2InnerShadowHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor.ar = saturate((1 - fcolor.ar) - (1 - fcolor.ra) * 0.5f);\n"
"    fcolor = (scolor * fcolor.a + scolor2 * fcolor.r\n"
"              + base * (1 - fcolor.a - fcolor.r)) * base.a;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2InnerShadowMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor = lerp(scolor, base, fcolor.a) * base.a;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2InnerShadowMulHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2Dlod(srctex,float4( tc * srctexscale,0, 0.0f));\n"
"      fcolor.ar = saturate((1 - fcolor.ar) - (1 - fcolor.ra) * 0.5f);\n"
"    fcolor = (scolor * fcolor.a + scolor2 * fcolor.r\n"
"              + base * (1 - fcolor.a - fcolor.r)) * base.a;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2ShadowKnockout = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = scolor * fcolor.a * (1-base.a) + base;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowKnockoutHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = (scolor * fcolor.a + scolor2 * fcolor.r) * (1-base.a) + base;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowKnockoutMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = scolor * fcolor.a * (1-base.a) + base;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2ShadowKnockoutMulHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = (scolor * fcolor.a + scolor2 * fcolor.r) * (1-base.a) + base;\n"
"    fcolor *= (1 - base.a);\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2Shadow = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = scolor * fcolor.a * (1-base.a) + base;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = (scolor * fcolor.a + scolor2 * fcolor.r) * (1-base.a) + base;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = scolor * fcolor.a * (1-base.a) + base;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2ShadowMulHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float4 scolor2 : register(c5);\n"
"float2 srctexscale : register(c6);\n"
"float2 texscale : register(c7);\n"
"sampler srctex : register(s0);\n"
"sampler tex : register(s1);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  float4 base = tex2D(srctex, tc * srctexscale);\n"
"\n"
"      fcolor = (scolor * fcolor.a + scolor2 * fcolor.r) * (1-base.a) + base;\n"
"    fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2Shadowonly = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float2 texscale : register(c5);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  fcolor = scolor * fcolor.a;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowonlyHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float2 texscale : register(c5);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  fcolor = scolor * fcolor.a;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2ShadowonlyMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float2 texscale : register(c5);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f));\n"
"      }  fcolor = color * fsize.w;\n"
"  fcolor = scolor * fcolor.a;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2ShadowonlyMulHighlight = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 offset : register(c3);\n"
"float4 scolor : register(c4);\n"
"float2 texscale : register(c5);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"  {           color.a += tex2Dlod(tex,float4( tc + (offset + i) * texscale,0, 0.0f)).a;\n"
"       color.r += tex2Dlod(tex,float4( tc - (offset + i) * texscale,0, 0.0f)).a;\n"
"      }  fcolor = color * fsize.w;\n"
"  fcolor = scolor * fcolor.a;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_VVatc = 
"float4 mvp[2] : register(c0);\n"
"void main(float2 atc : TEXCOORD0,\n"
"          float4 pos : POSITION,\n"
"          out float2 tc : TEXCOORD0,\n"
"          out float4 vpos : POSITION) {\n"
"\n"
"  vpos = pos;\n"
"  vpos.x = dot(pos, mvp[0]);\n"
"  vpos.y = dot(pos, mvp[1]);  \n"
"  tc = atc;\n"
"}";

const char* pSource_FBox1Blur = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 texscale : register(c3);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float  i = 0;\n"
"  for (i = -fsize.x; i <= fsize.x; i++)\n"
"    color += tex2Dlod(tex,float4( tc + i * texscale,0, 0.0f));\n"
"  fcolor = color * fsize.w;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox1BlurMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 texscale : register(c3);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float  i = 0;\n"
"  for (i = -fsize.x; i <= fsize.x; i++)\n"
"    color += tex2Dlod(tex,float4( tc + i * texscale,0, 0.0f));\n"
"  fcolor = color * fsize.w;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FBox2Blur = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 texscale : register(c3);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"    color += tex2Dlod(tex,float4( tc + i * texscale,0, 0.0f));\n"
"  fcolor = color * fsize.w;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"}";

const char* pSource_FBox2BlurMul = 
"float4 cxadd : register(c0);\n"
"float4 cxmul : register(c1);\n"
"float4 fsize : register(c2);\n"
"float2 texscale : register(c3);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 color = 0;\n"
"  float2 i = 0;\n"
"  for (i.x = -fsize.x; i.x <= fsize.x; i.x++)\n"
"    for (i.y = -fsize.y; i.y <= fsize.y; i.y++)\n"
"    color += tex2Dlod(tex,float4( tc + i * texscale,0, 0.0f));\n"
"  fcolor = color * fsize.w;\n"
"  fcolor = fcolor * cxmul + cxadd * fcolor.a;\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

const char* pSource_FCMatrix = 
"float4 cxadd : register(c0);\n"
"float4x4 cxmul : register(c1);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 c = tex2D(tex, tc);\n"
"  fcolor = mul(c,cxmul) + cxadd * (c.a + cxadd.a);\n"
"}";

const char* pSource_FCMatrixMul = 
"float4 cxadd : register(c0);\n"
"float4x4 cxmul : register(c1);\n"
"sampler tex : register(s0);\n"
"void main(float2 tc : TEXCOORD0,\n"
"          out float4 fcolor : COLOR) {\n"
"  float4 c = tex2D(tex, tc);\n"
"  fcolor = mul(c,cxmul) + cxadd * (c.a + cxadd.a);\n"
"  fcolor = lerp(1, fcolor, fcolor.a);\n"
"}";

enum VertexShaderType2
{
    VS2_None = 0,
    VS2_VVatc,
    VS2_Count
};

static const char* VShaderSources2[VS2_Count] = {
    NULL,
    pSource_VVatc,
};

enum VertexShaderUniform
{
    VSU_mvp,
    VSU_Count
};

static const int VUniforms_VVatc[] = {0};

static const int* VShaderUniforms[VS2_Count] = {
    NULL,
    VUniforms_VVatc,
};

enum FragShaderType2
{
    FS2_shadows_Highlight            = 0x00000001,
    FS2_shadows_Mul                  = 0x00000002,
    FS2_shadows_Knockout             = 0x00000004,
    FS2_blurs_Box2                 = 0x00000001,
    FS2_blurs_Mul                  = 0x00000002,
    FS2_cmatrix_Mul                  = 0x00000001,
    FS2_None = 0,
    FS2_FBox2InnerShadow,
    FS2_FBox2InnerShadowHighlight,
    FS2_FBox2InnerShadowMul,
    FS2_FBox2InnerShadowMulHighlight,
    FS2_FBox2InnerShadowKnockout,
    FS2_FBox2InnerShadowKnockoutHighlight,
    FS2_FBox2InnerShadowKnockoutMul,
    FS2_FBox2InnerShadowKnockoutMulHighlight,
    FS2_FBox2Shadow,
    FS2_FBox2ShadowHighlight,
    FS2_FBox2ShadowMul,
    FS2_FBox2ShadowMulHighlight,
    FS2_FBox2ShadowKnockout,
    FS2_FBox2ShadowKnockoutHighlight,
    FS2_FBox2ShadowKnockoutMul,
    FS2_FBox2ShadowKnockoutMulHighlight,
    FS2_FBox2Shadowonly,
    FS2_FBox2ShadowonlyHighlight,
    FS2_FBox2ShadowonlyMul,
    FS2_FBox2ShadowonlyMulHighlight,
    FS2_FBox1Blur,
    FS2_FBox2Blur,
    FS2_FBox1BlurMul,
    FS2_FBox2BlurMul,
    FS2_FCMatrix,
    FS2_FCMatrixMul,
    FS2_Count
};

static const char* FShaderSources2[FS2_Count] = {
    NULL,
    pSource_FBox2InnerShadow,
    pSource_FBox2InnerShadowHighlight,
    pSource_FBox2InnerShadowMul,
    pSource_FBox2InnerShadowMulHighlight,
    pSource_FBox2InnerShadowKnockout,
    pSource_FBox2InnerShadowKnockoutHighlight,
    pSource_FBox2InnerShadowKnockoutMul,
    pSource_FBox2InnerShadowKnockoutMulHighlight,
    pSource_FBox2Shadow,
    pSource_FBox2ShadowHighlight,
    pSource_FBox2ShadowMul,
    pSource_FBox2ShadowMulHighlight,
    pSource_FBox2ShadowKnockout,
    pSource_FBox2ShadowKnockoutHighlight,
    pSource_FBox2ShadowKnockoutMul,
    pSource_FBox2ShadowKnockoutMulHighlight,
    pSource_FBox2Shadowonly,
    pSource_FBox2ShadowonlyHighlight,
    pSource_FBox2ShadowonlyMul,
    pSource_FBox2ShadowonlyMulHighlight,
    pSource_FBox1Blur,
    pSource_FBox2Blur,
    pSource_FBox1BlurMul,
    pSource_FBox2BlurMul,
    pSource_FCMatrix,
    pSource_FCMatrixMul,
};

enum FragShaderUniform
{
    FSU_cxadd,
    FSU_cxmul,
    FSU_fsize,
    FSU_offset,
    FSU_scolor,
    FSU_scolor2,
    FSU_srctex,
    FSU_srctexscale,
    FSU_tex,
    FSU_texscale,
    FSU_Count
};

static const int FUniforms_FBox2InnerShadow[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowMul[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowMulHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowKnockout[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowKnockoutHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowKnockoutMul[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2InnerShadowKnockoutMulHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2Shadow[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowMul[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowMulHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowKnockout[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowKnockoutHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowKnockoutMul[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2ShadowKnockoutMulHighlight[] = {0, 1, 2, 3, 4, 5, 0, 6, 1, 7};
static const int FUniforms_FBox2Shadowonly[] = {0, 1, 2, 3, 4, -1, -1, -1, 0, 5};
static const int FUniforms_FBox2ShadowonlyHighlight[] = {0, 1, 2, 3, 4, -1, -1, -1, 0, 5};
static const int FUniforms_FBox2ShadowonlyMul[] = {0, 1, 2, 3, 4, -1, -1, -1, 0, 5};
static const int FUniforms_FBox2ShadowonlyMulHighlight[] = {0, 1, 2, 3, 4, -1, -1, -1, 0, 5};
static const int FUniforms_FBox1Blur[] = {0, 1, 2, -1, -1, -1, -1, -1, 0, 3};
static const int FUniforms_FBox2Blur[] = {0, 1, 2, -1, -1, -1, -1, -1, 0, 3};
static const int FUniforms_FBox1BlurMul[] = {0, 1, 2, -1, -1, -1, -1, -1, 0, 3};
static const int FUniforms_FBox2BlurMul[] = {0, 1, 2, -1, -1, -1, -1, -1, 0, 3};
static const int FUniforms_FCMatrix[] = {0, 1, -1, -1, -1, -1, -1, -1, 0, -1};
static const int FUniforms_FCMatrixMul[] = {0, 1, -1, -1, -1, -1, -1, -1, 0, -1};

static const int* FShaderUniforms[FS2_Count] = {
    NULL,
    FUniforms_FBox2InnerShadow,
    FUniforms_FBox2InnerShadowHighlight,
    FUniforms_FBox2InnerShadowMul,
    FUniforms_FBox2InnerShadowMulHighlight,
    FUniforms_FBox2InnerShadowKnockout,
    FUniforms_FBox2InnerShadowKnockoutHighlight,
    FUniforms_FBox2InnerShadowKnockoutMul,
    FUniforms_FBox2InnerShadowKnockoutMulHighlight,
    FUniforms_FBox2Shadow,
    FUniforms_FBox2ShadowHighlight,
    FUniforms_FBox2ShadowMul,
    FUniforms_FBox2ShadowMulHighlight,
    FUniforms_FBox2ShadowKnockout,
    FUniforms_FBox2ShadowKnockoutHighlight,
    FUniforms_FBox2ShadowKnockoutMul,
    FUniforms_FBox2ShadowKnockoutMulHighlight,
    FUniforms_FBox2Shadowonly,
    FUniforms_FBox2ShadowonlyHighlight,
    FUniforms_FBox2ShadowonlyMul,
    FUniforms_FBox2ShadowonlyMulHighlight,
    FUniforms_FBox1Blur,
    FUniforms_FBox2Blur,
    FUniforms_FBox1BlurMul,
    FUniforms_FBox2BlurMul,
    FUniforms_FCMatrix,
    FUniforms_FCMatrixMul,
};

